package com.hxkj.entity.enums;

import com.hxkj.domain.enums.AuthRoleExceptionEnum;
import com.platform.common.domain.exception.CustomExceptionCode;

/**
 * 前台用户提交曝光和咨询异常枚举类
 * <p>
 * Created by chenfangzhou
 */
public enum SmsExceptionEnum implements CustomExceptionCode {
   //异常枚举

    TELEPHONE_IS_NULL(600, "手机号为空", 900),
    CODE_IS_NULL(601, "验证码为空", 900),
    GET_CODE_ERROR(602, "系统获取验证码异常", 900),
    CODE_IS_ERROR(603, "图片验证码错误", 900),



    ;

    private Integer code;
    private String msg;
    private Integer httpCode;

    SmsExceptionEnum(Integer code, String msg, Integer httpCode) {
        this.code = code;
        this.msg = msg;
        this.httpCode = httpCode;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public Integer getHttpCode() {
        return httpCode;
    }

    @Override
    public void setHttpCode(Integer httpCode) {
        this.httpCode = httpCode;
    }

    public static SmsExceptionEnum getEnumByCode(Integer code){
        for(SmsExceptionEnum smsExceptionEnum : SmsExceptionEnum.values()){
            if(code.equals(smsExceptionEnum.getCode())){
                return smsExceptionEnum;
            }
        }
        return null;
    }
}
